<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生产监控</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-50">
    <!-- Header -->
    <div class="bg-white p-4 shadow-sm">
        <div class="flex items-center justify-between">
            <h1 class="text-xl font-semibold text-gray-800">生产监控</h1>
            <div class="flex items-center space-x-2">
                <button class="p-2 text-gray-600 hover:text-gray-800">
                    <i class="fas fa-bell"></i>
                </button>
                <button class="p-2 text-gray-600 hover:text-gray-800">
                    <i class="fas fa-ellipsis-v"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="p-4 space-y-4">
        <!-- Production Overview Card -->
        <div class="bg-white rounded-lg shadow-sm p-4">
            <div class="flex justify-between items-center mb-4">
                <h2 class="text-lg font-medium text-gray-800">今日生产概览</h2>
                <span class="text-sm text-gray-500">实时更新</span>
            </div>
            <div class="grid grid-cols-3 gap-4">
                <div class="text-center">
                    <div class="text-2xl font-bold text-blue-600">1,234</div>
                    <div class="text-sm text-gray-600">总产出</div>
                </div>
                <div class="text-center">
                    <div class="text-2xl font-bold text-green-600">98.5%</div>
                    <div class="text-sm text-gray-600">良率</div>
                </div>
                <div class="text-center">
                    <div class="text-2xl font-bold text-purple-600">95.2%</div>
                    <div class="text-sm text-gray-600">直通率</div>
                </div>
            </div>
        </div>

        <!-- Production Line Status -->
        <div class="bg-white rounded-lg shadow-sm p-4">
            <h2 class="text-lg font-medium text-gray-800 mb-4">产线状态</h2>
            <div class="space-y-3">
                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                    <div class="flex items-center space-x-3">
                        <div class="w-3 h-3 rounded-full bg-green-500"></div>
                        <span class="font-medium">产线A</span>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium">运行中</div>
                        <div class="text-xs text-gray-500">产出: 456件</div>
                    </div>
                </div>
                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                    <div class="flex items-center space-x-3">
                        <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                        <span class="font-medium">产线B</span>
                    </div>
                    <div class="text-right">
                        <div class="text-sm font-medium">待机中</div>
                        <div class="text-xs text-gray-500">产出: 378件</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Production Trend -->
        <div class="bg-white rounded-lg shadow-sm p-4">
            <h2 class="text-lg font-medium text-gray-800 mb-4">生产趋势</h2>
            <canvas id="productionChart" height="200"></canvas>
        </div>
    </div>

    <script>
        // Production Trend Chart
        const ctx = document.getElementById('productionChart').getContext('2d');
        new Chart(ctx, {
            type: 'line',
            data: {
                labels: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
                datasets: [{
                    label: '产出数量',
                    data: [120, 190, 300, 250, 200, 280, 320],
                    borderColor: '#1677ff',
                    tension: 0.4,
                    fill: false
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });
    </script>
</body>
</html> 